#pragma once

#include <cstdint>

namespace jianzhi_015
{

class Solution
{
public:
    int hammingWeight(uint32_t n)
    {
        int num = 0;
        while (n) {
            n &= (n - 1);
            ++num;
        }
        return num;
    }
};

}  /* namespace jianzhi_015 */
